package day03;

import java.util.Scanner;

public class IfDemoTest {
    public static void main(String[] args) {

        Scanner scanner=new Scanner(System.in);
        int n=0 ;
        double sum=0;
        while(n<99999999)
        {
            System.out.println("请输入商品金额：");
            double price= scanner.nextDouble();

            sum=sum+price;
            n++;
            if(price==0){
                break;
            }
        }
        if(sum>=500&&sum<=1000){
            sum=sum*0.8;

        }
        else if(sum==199){
            sum-=100;
        }
        else if(sum>1000){
            sum*=0.6;
        }
        System.out.println("最终消费金额为"+sum+"元");
    }
}
